﻿using System;
using System.Collections.Generic;
using System.Dynamic;

namespace ConsoleDemo
{
    internal class DicDemo
    {
        public static void DicTest1()
        {
            dynamic myObj = new ExpandoObject();
            Dictionary<string, object> dic = new Dictionary<string, object>()
            {
                {"Name","Frank"},
                {"Age",23}
            };

            //myObj = new MyExtendsObject(dic);
            Console.WriteLine(myObj.Age);


            dynamic obj = new ExpandoObject();
            ((IDictionary<string, object>)obj).Add("Name", "张三");
            Console.ReadLine();
        }
    }
}
